package com.feib.stms.dao;


import java.util.Arrays;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


import com.feib.stms.model.Group;
import com.feib.stms.model.UploadFileTodoList;
import com.feib.stms.model.User;
import com.feib.stms.pagination.PaginatedList;

import com.feib.stms.service.UploadFileTodoListService;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"applicationContext-config.xml", "applicationContext-dao.xml"})
public class UploadFileDaoTodoListTester {


	@Autowired
	@Qualifier("uploadFileTodoListService")
	private UploadFileTodoListService uploadFileTodoListService;


	

	public  static UploadFileTodoListDao uploadFileTodoListDao;



	@Test
	public void testQueryByPaginatedList()
	{

		PaginatedList<UploadFileTodoList> paginatedList = new PaginatedList<UploadFileTodoList>();

		paginatedList.setPageSize(10);
		paginatedList.setPageNumber(2);
		//paginatedList.setSortCriterion("ACTION_NAME");
		


		User user=new User();
		user.setDealSecuritiesNos("2543,2544");
        user.setGroup(new Group());
        user.getGroup().setGroupPk(new Long(1));

		paginatedList=uploadFileTodoListService.findUploadFileTodoList(user, paginatedList);
		
		
		String[] securitiesNos = user.getDealSecuritiesNos().split(",");		
		System.out.print(securitiesNos);
	    List<String> listSecuritiesNo = Arrays.asList(securitiesNos);

	    for(String s:listSecuritiesNo)
	    System.out.print(s);
	    
		//System.out.print(paginatedList.getPaginatedList());
		



	}




}
